﻿<%@ WebHandler Language="C#" Class="Ajax_userlist" %>

using System;
using System.Web;
using System.Data;
using BackboneTest.BLL;
using BackboneTest.Models;
using Newtonsoft.Json;

public class Ajax_userlist : IHttpHandler {
    TB_UserBLL bll = new TB_UserBLL();
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "application/json";
        context.Response.Write(GetUserlist());
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

    private string GetUserlist()
    {
        DataTable dt = bll.GetList();
        return JsonConvert.SerializeObject(dt);
    }

}